package cn.com.ylg.yang_lbs_20170301;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import com.baidu.mapapi.map.BaiduMap;
import com.baidu.mapapi.map.MapView;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by MyPC on 2017/3/1.
 * 实况交通图
 */

public class TrafficActivity extends AppCompatActivity {
    @Bind(R.id.bmapView)
    MapView mMapView;

    private BaiduMap mBaiduMap;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_traffic);
        ButterKnife.bind(this);
        mBaiduMap = mMapView.getMap();
        //开启实况交通图;
        mBaiduMap.setTrafficEnabled(true);
    }
    @Override
    protected void onDestroy() {
        super.onDestroy();
        // 在activity执行onDestroy时执行mMapView.onDestroy()，实现地图生命周期管理
        mMapView.onDestroy();
    }

    @Override
    protected void onResume() {
        super.onResume();
        // 在activity执行onResume时执行mMapView. onResume ()，实现地图生命周期管理
        mMapView.onResume();
    }

    @Override
    protected void onPause() {
        super.onPause();
        // 在activity执行onPause时执行mMapView. onPause ()，实现地图生命周期管理
        mMapView.onPause();
    }
}
